﻿
using System;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using Abp.Application.Services.Dto;
using Abp.Extensions;
using KDS.Mes.Mes.AlcCodes;

namespace KDS.Mes.Mes.AlcCodes.EntityMapper.AlcCodes
{

	/// <summary>
    /// ALCCode信息的数据配置文件
    /// </summary>
    public class AlcCodeCfg : EntityTypeConfiguration<AlcCode>
    {
		/// <summary>
        ///  构造方法[默认链接字符串< see cref = "MesDbContext" /> ]
        /// </summary>
		public AlcCodeCfg ()
		{
		            ToTable("AlcCode", MesConsts.SchemaName.Basic);
 
      //todo: 需要将以下文件注入到MesDbContext中

  //		public IDbSet<AlcCode> AlcCodes { get; set; }
   //		 modelBuilder.Configurations.Add(new AlcCodeCfg());




		    // Style - 关系映射
			HasRequired(a => a.Style).WithMany().HasForeignKey(c => c.StyleId).WillCascadeOnDelete(true);


		    // ALCCode
			Property(a => a.ALCCode).HasMaxLength(20);
		 //   // 零件号
			//Property(a => a.SeatNo).HasMaxLength(20);
		    // 车式样
			Property(a => a.CarStyle).HasMaxLength(20);
		}
    }
}